package com.zlzxm.studentscreen.util;

import android.content.Context;
import android.view.Gravity;
import android.widget.Toast;

import es.dmoral.toasty.Toasty;


/**
 * CREATE BY zlzxm ON 1/6/21
 */
public class ToastyUtil {


    public static long TIME_DURATION  = 3000;

    public static long CURRENT_TIME = 0;

    public static String lastContent;


    static {


        Toasty.Config.getInstance().allowQueue(false).apply();
    }

    public static void infoToast(Context context,String msg){



        Toast toast =  Toasty.info(context,msg);
        toast .setGravity(Gravity.CENTER,0,0);
        toast.show();

    }

    public static void errorToast(Context context,String msg){



        Toast toast =  Toasty.error(context,msg);
        toast .setGravity(Gravity.CENTER,0,0);
        toast.show();

    }

    public static void succeedToast(Context context,String msg){

        Toast toast =  Toasty.success(context,msg);
        toast .setGravity(Gravity.CENTER,0,0);
        toast.show();
    }

    public static void warningToast(Context context,String msg){

        Toast toast =  Toasty.warning(context,msg);
        toast .setGravity(Gravity.CENTER,0,0);
        toast.show();

    }

    public static void normalToast(Context context,String msg){

        Toast toast =  Toasty.normal(context,msg);
        toast .setGravity(Gravity.CENTER,0,0);
        toast.show();

    }


}
